package com.ald.plane_tool.ui.activity;

import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;

import androidx.navigation.NavController;
import androidx.navigation.Navigation;

import com.ald.plane_tool.BR;
import com.ald.plane_tool.R;
import com.ald.plane_tool.databinding.ActivityMainBinding;
import com.ald.plane_tool.viewmodle.MainViewModle;
import com.aleyn.mvvm.base.BaseActivity;

import org.jetbrains.annotations.Nullable;

public class MainActivity extends BaseActivity<MainViewModle, ActivityMainBinding> {




    @Override
    public int layoutId() {
        return R.layout.activity_main;
    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {



    }

    @Override
    public void initData() {

    }

    @Override
    public void initCLick() {

    }

    @Override
    public int variableID() {
        return BR.MainViewModle;
    }

    @Override
    public void bindViewModel() {

    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        //判断用户是否点击了“返回键”
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            //与上次点击返回键时刻作差
            Log.i("TAG", "onKeyDown: "+55555);
            NavController navController = Navigation.findNavController(this, R.id.fragment);
            navController.navigateUp();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}